var v = new Vue({
    el:"#app",
    data:{
        imgs:['image/0.jpeg','image/1.png','image/2.jpeg','image/3.jpeg','项目素材/动作/奇谋妙计五福星.webp','项目素材/动作/速度与激情7.webp'],
        guangGao:{},
        showMovie:{},
        userMsg:{userid:""},//userid:""
        linksdata:{},
        movies:{},
        times:1,
    },
    created(){
        this.showMovies();
        this.getUserMsg();
        this.queryLinks();
        this.queryMovies();
        this.queryGG();
    },
    updated(){
        this.move();
    },
    methods:{
        showMovies(){
            axios.get("QuryShowListMoviesServlet.s").then(res=>{
                this.showMovie=res.data;
            });
        },
        move(){
            this.times++;
            console.log(this.times)
            if (this.times===5){
                let oUl = this.$refs.myul;
                oUl.innerHTML+=oUl.innerHTML;
                let aLi = document.querySelectorAll('.solidphoto');

                oUl.style.width=aLi[0].offsetWidth * aLi.length + 'px';
                let speed = -1;
                let move = ()=>{
                    if (oUl.offsetLeft < -oUl.offsetWidth/2){
                        oUl.style.left = 0;
                    }
                    oUl.style.left=oUl.offsetLeft + speed + 'px';
                }
                setInterval(move,10);
            }
        },
        getUserMsg(){
            axios.get("GetUserMessageServlet.s").then(res=>{
                if (res.data.data!=null){
                    this.userMsg=res.data.data;
                }
            });
        },
        queryGG(){
            axios.get("GuangGaoServlet.s",{
                params:{
                    area:'index-gg'
                }
            }).then(res=>{
                    this.guangGao=res.data.data;
            });
        },
        queryMovies(){
            axios.get("QueryNewMoviesServlet.s").then(res=>{
                this.movies=res.data.data;
            });

        },
        queryLinks(){
            axios.get("UserQueryLinksServlet.s").then(res=>{
                this.linksdata=res.data;
            })
        }

    }
});
// //利用偏移量是图片滑动
function photoMove1(){

}
photoMove1();
//
//
function photoMove2(){
    let oUl2 = document.querySelector('.main-lists-ul2');
    oUl2.innerHTML+=oUl2.innerHTML;
    let aLi2 = document.querySelectorAll('.solidphoto2');
    oUl2.style.width=aLi2[0].offsetWidth * aLi2.length + 'px';
    let speed2 = -2;
    let move2 = ()=>{
        if (oUl2.offsetLeft < -oUl2.offsetWidth/2){
            oUl2.style.left = 0;
        }
        oUl2.style.left=oUl2.offsetLeft + speed2 + 'px';
    }
    let timer= setInterval(move2,30);
}
photoMove2();